import http from './http'

interface DwLogin {
  code: string
  qr_type: number
}

interface BindItem {
  union_id: string
  qr_type: number
  account: string
  password: string
}

/**
 * 钉钉微信登录
 * @params code 钉钉微信code
 * @params qr_type 1:钉钉；2:微信
 */
export function dwLogin(data: DwLogin) { 
  http.get()
  return http.get({
    header: { 'Content-Type': 'application/x-www-form-urlencoded' },
    method: 'Post',
    url: '/v1/third/dw/login',
    data
  })
}

/**
 * 钉钉微信绑定并登录
 */
export function bindAccount(data: BindItem) {
  return http.request({
    header: { 'Content-Type': 'application/x-www-form-urlencoded' },
    method: 'Post',
    url: '/v1/third/dw/bind',
    data
  })
}
